#pragma once
#include "AppPlugin.h"
#include "HostDispatchImpl.h"

namespace PluginSDK {
	class CBackgroundTask : public PluginSDK::IHostDispatchImpl<VGCore::ICUIBackgroundTask>
	{
	private:
		_bstr_t m_name;
		template<class _Fn>
		static _Fn &&m_Run;
	public:
		CBackgroundTask(_bstr_t name);
		template<class _Fn,
			class... _Args,
			class = enable_if_t<!is_same<decay_t<_Fn>, CBackgroundTask>::value>>
			void SetRunTask(_Fn&& _fx, _Args&&... _Ax) {
			//m_Run = _fx;
		}
	private:
		HRESULT __stdcall raw_RunTask();
		HRESULT __stdcall raw_FinalizeTask();
		HRESULT __stdcall raw_FreeTask();
		HRESULT __stdcall raw_QuitTask();
		HRESULT __stdcall get_Name(BSTR * pVal);
	};
}
